//
//  demo1医院导航
app.controller('demo1Ctrl', [
    '$scope', '$stateParams', 'httpService',
    function($scope, $stateParams, httpService) {
        var latitude, longitude;
        var latitude, longitude;
        latitude = void 0;
        longitude = void 0;
        longitude = 121.48265;
        latitude = 31.230433;
        //  显示地图
        $scope.mapOptions = {
            center: {
                longitude: longitude,
                latitude: latitude
            },
            zoom: 18,
            city: '上海',
            markers: [{
                longitude: longitude,
                latitude: latitude,
                icon: 'img/common/map.png',
                width: 48,
                height: 48,
                title: '上海力宝医院',
                content: '地址：黄浦区淮海中路222号力宝广场505室'
            }]
        };
        $scope.getNavigation = function() {
            httpService.query('hospital').then(function(res) {
                if (res.code === 200) {
                    $scope.hospital = res.data;
                    $scope.mapOptions.center.longitude = $scope.mapOptions.markers[0].longitude = parseFloat($scope.hospital.lng);
                    $scope.mapOptions.center.latitude = $scope.mapOptions.markers[0].latitude = parseFloat($scope.hospital.lat);
                    $scope.mapOptions.markers[0].title = $scope.hospital.name;
                    $scope.mapOptions.markers[0].content = $scope.hospital.address;
                }
            });
        };
        $scope.getNavigation();
    }
]);